package com.siao.example.libaray.component.view
{
	import com.siao.component.List;
	import com.siao.component.Orientation;
	import com.siao.data.ArrayList;
	import com.siao.example.common.ui.Layer;
	import com.siao.example.libaray.component.ui.ListItem;
	import com.siao.mvc.View;
	
	/**
	 * 列表视图
	 * @author SiaoLeon
	 */
	public class ComponentListView extends View
	{
		// -------------------------------------------------------------------------------------------------------- 静态常量
		
		// -------------------------------------------------------------------------------------------------------- 静态变量
		
		// -------------------------------------------------------------------------------------------------------- 静态方法
		
		// -------------------------------------------------------------------------------------------------------- 静态函数
		
		// -------------------------------------------------------------------------------------------------------- 属性
		
		// -------------------------------------------------------------------------------------------------------- 变量
		
		private var list:List;
		
		// -------------------------------------------------------------------------------------------------------- 构造
		
		/**
		 * 构造函数
		 */
		public function ComponentListView()
		{
			super();
			
			var data:ArrayList = new ArrayList();
			
			for (var i:int = 0; i < 10; i++)
			{
				data.add(i);
			}
			
			this.list = new List(Orientation.BOTTOM_TOP, Orientation.RIGHT_LEFT);
			this.list.draw(0X000000, 0.2);
			this.list.margin = 10;
			this.list.marginTop = 80;
			this.list.padding = 10;
			this.list.rowSpacing = this.list.colSpacing = 5;
			this.list.wrap = true;
			this.list.multiSelected = true;
			this.list.cancelMode = true;
			this.list.bind(ListItem, data);
		}
		
		// -------------------------------------------------------------------------------------------------------- 方法
		
		override public function onAdd():void
		{
			Layer.instance.content.addChild(this.list);
		}
		
		override public function onRemove():void
		{
			Layer.instance.content.removeChild(this.list);
		}
	
		// -------------------------------------------------------------------------------------------------------- 函数
	
	}
}
